/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mylist;

import java.util.Iterator;

/**
 *
 * @author Dasha Ragimova
 */
public interface MyListIterator<E> extends Iterator<E> {
     /**
     * 
     * @return true if this list iterator has more elements when
     * traversing the list in the forward direction. 
     */
    boolean hasNext();

    /**
     *
     * @return the next element in the list
     */
    E next();

    /**
     * @return true if the list iterator has more elements when
     *         traversing the list in the reverse direction
     */
    boolean hasPrevious();

    /**
     * @return the previous element in the list
     * 
     */
    E previous();

    /**
     * @return the index of the element that would be returned by a
     *         subsequent call to next, or list size if the list
     *         iterator is at the end of the list
     */
    int nextIndex();

    /**
     * Removes from the list the last element that was returned 
     */
    
    void remove();

    /**
     * Replaces the last element returned 
     */
    void set(E e);

    /**
     * Inserts the specified element into the list (optional operation).
     * The element is inserted immediately before the element that
     * would be returned by next, if any, and after the element
     * that would be returned by previous, if any.  
     */
    void add(E e);
}